<?php

namespace app\validate\api\recovery;

use think\Validate;

class productValidate extends Validate
{

    protected $rule = [
        'category_id'   => 'require',
        //'brand'         => 'require',
        'product_name'  => 'require',
        'price'         => 'require',
        'warranty'      => 'require',
        'is_invoice'    => 'require',
        'is_sale'       => 'require',
        'use_date'      => 'require',
        'images'        => 'require',
        'product_desc'  => 'require',
        'address'       => 'require',
        'detail_address'=> 'require',
    ];


    protected $message = [
        'category_id.require'   => '请选择分类',
        //'brand.require'         => 'brand品牌id必填',
        'product_name.require'  => '商品名称必填',
        'price.require'         => '商品价格必填',
        'warranty.require'      => '是否质保必填',
        'is_invoice.require'    => '是否有发票必填',
        'is_sale.require'       => '是否预售必填',
        'use_date.require'      => '使用时间必填',
        'images.require'        => '请上传图片',
        'product_desc.require'  => '商品描述必填',
        'address.require'       => '取件地址必填',
        'detail_address.require'=> '详细地址必填',
    ];

}